package com.itheima.atomic;

import com.sun.security.jgss.GSSUtil;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;

public class Demo01 {
    public static void main(String[] args) {
        //AtomicInteger ac = new AtomicInteger();
        AtomicLong ac = new AtomicLong();
        AtomicLong ac2 = new AtomicLong(10L);
        System.out.println(ac);
        System.out.println(ac2);
        long l = ac.get();
        System.out.println(l);
        System.out.println(ac.incrementAndGet());
        System.out.println(ac.getAndIncrement());
        System.out.println(ac.get());

        System.out.println(ac2.decrementAndGet());
        System.out.println(ac2.getAndDecrement());
        System.out.println(ac2.get());

        System.out.println(ac2.getAndAdd(10L));
        System.out.println(ac2.get());
        System.out.println(ac2.addAndGet(100L));

        System.out.println(ac2.getAndSet(5000));
        System.out.println(ac2.get());

    }

}
